#!/usr/bin/env node

const fs = require('fs'),
      fileName = process.argv[2] || __filename,
      log = console.log;

try{

  let stm = fs.createReadStream(fileName);

  if(!fs.statSync(fileName).isFile()){
    log(`${fileName} is not file!`);
    process.exit(1);
  }
  stm.pipe(process.stdout);
}catch(e){
  console.error(e.message);
  process.exit(2);
}
